home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-2.iso / Files II / Multimedia / Q-Z / VCR+(app+src).sit / Sources / encoder.c < prev    next >
MacBinary  |  1993-03-17  |  2.1 KB  |  [TEXT/KAHL]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Wed Mar 17 21:34:04 1993, modified Wed Mar 17 21:34:04 1993, creator Think C, type ASCII, 1190 bytes "encoder.c" , at 0x526 706 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[KAHL]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 09 65 6e 63 6f 64 65 | 72 2e 63 00 00 00 00 00 |..encode|r.c.....|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4b 41 48 | 4c 00 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 04 a6 00 | 00 02 c2 a7 cd 90 1c a7 |........|........|
|00000060| cd 90 1c 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 02 04 00 00 |........|........|
|00000080| 23 69 6e 63 6c 75 64 65 | 20 22 56 43 52 70 6c 75 |#include| "VCRplu|
|00000090| 73 2e 68 22 0d 0d 65 78 | 74 65 72 6e 09 76 63 72 |s.h"..ex|tern.vcr|
|000000a0| 49 6e 66 6f 09 6d 79 56 | 43 52 3b 0d 0d 76 6f 69 |Info.myV|CR;..voi|
|000000b0| 64 20 65 6e 63 6f 64 65 | 72 28 76 6f 69 64 29 0d |d encode|r(void).|
|000000c0| 7b 0d 09 6c 6f 6e 67 20 | 09 6a 2c 20 64 6f 6e 65 |{..long |.j, done|
|000000d0| 66 6c 61 67 2c 20 74 62 | 6c 69 64 78 20 3b 0d 09 |flag, tb|lidx ;..|
|000000e0| 6c 6f 6e 67 20 09 73 31 | 5f 6f 75 74 2c 20 62 6f |long .s1|_out, bo|
|000000f0| 74 33 2c 20 74 6f 70 35 | 2c 20 71 75 6f 2c 20 72 |t3, top5|, quo, r|
|00000100| 65 6d 20 3b 0d 09 6c 6f | 6e 67 20 09 73 34 5f 6f |em ;..lo|ng .s4_o|
|00000110| 75 74 2c 20 73 35 5f 6f | 75 74 2c 20 6f 66 6f 75 |ut, s5_o|ut, ofou|
|00000120| 74 20 3b 0d 09 53 74 72 | 33 32 09 63 6f 64 65 54 |t ;..Str|32.codeT|
|00000130| 65 78 74 3b 0d 0d 0d 09 | 2f 2a 20 67 65 74 20 74 |ext;....|/* get t|
|00000140| 68 65 20 20 74 20 20 62 | 69 74 73 20 61 6e 64 20 |he t b|its and |
|00000150| 74 68 65 20 20 63 20 20 | 62 69 74 73 20 2a 2f 0d |the c |bits */.|
|00000160| 09 74 62 6c 69 64 78 20 | 3d 20 6c 6f 6f 6b 75 70 |.tblidx |= lookup|
|00000170| 32 28 6d 79 56 43 52 2e | 73 74 61 72 74 54 69 6d |2(myVCR.|startTim|
|00000180| 65 2c 20 6d 79 56 43 52 | 2e 64 75 72 61 74 69 6f |e, myVCR|.duratio|
|00000190| 6e 29 3b 0d 0d 09 2f 2a | 20 66 72 6f 6d 20 74 68 |n);.../*| from th|
|000001a0| 65 6d 20 69 6e 66 65 72 | 20 77 68 61 74 20 6d 75 |em infer| what mu|
|000001b0| 73 74 20 68 61 76 65 20 | 62 65 65 6e 20 73 74 65 |st have |been ste|
|000001c0| 70 20 34 20 26 20 73 74 | 65 70 20 35 20 72 65 73 |p 4 & st|ep 5 res|
|000001d0| 75 6c 74 73 20 2a 2f 0d | 09 69 6e 74 65 72 6c 65 |ults */.|.interle|
|000001e0| 61 76 65 28 74 62 6c 69 | 64 78 2c 20 6d 79 56 43 |ave(tbli|dx, myVC|
|000001f0| 52 2e 63 68 61 6e 6e 65 | 6c 20 2d 20 31 2c 20 28 |R.channe|l - 1, (|
|00000200| 26 73 34 5f 6f 75 74 29 | 2c 20 28 26 73 35 5f 6f |&s4_out)|, (&s5_o|
|00000210| 75 74 29 29 20 3b 0d 0d | 09 2f 2a 20 66 69 6e 64 |ut)) ;..|./* find|
|00000220| 20 74 68 65 20 73 6d 61 | 6c 6c 65 73 74 20 75 6e | the sma|llest un|
|00000230| 6d 61 70 70 65 64 5f 74 | 6f 70 20 67 69 76 69 6e |mapped_t|op givin|
|00000240| 67 20 63 6f 72 72 65 63 | 74 20 6d 61 70 70 65 64 |g correc|t mapped|
|00000250| 5f 74 6f 70 20 2a 2f 0d | 09 74 6f 70 35 20 3d 20 |_top */.|.top5 = |
|00000260| 30 3b 0d 09 64 6f 6e 65 | 66 6c 61 67 20 3d 20 30 |0;..done|flag = 0|
|00000270| 3b 0d 0d 09 2f 2a 20 69 | 66 20 74 68 65 20 6d 61 |;.../* i|f the ma|
|00000280| 70 70 65 64 5f 74 6f 70 | 20 69 73 20 7a 65 72 6f |pped_top| is zero|
|00000290| 20 74 68 65 6e 20 74 6f | 70 20 61 6e 64 20 6f 66 | then to|p and of|
|000002a0| 66 73 65 74 20 61 72 65 | 20 7a 65 72 6f 20 2a 2f |fset are| zero */|
|000002b0| 0d 09 69 66 28 73 34 5f | 6f 75 74 20 3d 3d 20 30 |..if(s4_|out == 0|
|000002c0| 29 20 7b 20 74 6f 70 35 | 20 3d 20 30 3b 20 6f 66 |) { top5| = 0; of|
|000002d0| 6f 75 74 20 3d 20 30 3b | 20 64 6f 6e 65 66 6c 61 |out = 0;| donefla|
|000002e0| 67 20 3d 20 31 3b 20 7d | 0d 0d 09 77 68 69 6c 65 |g = 1; }|...while|
|000002f0| 28 64 6f 6e 65 66 6c 61 | 67 20 3d 3d 20 30 29 0d |(donefla|g == 0).|
|00000300| 09 7b 0d 09 09 74 6f 70 | 35 2b 2b 3b 0d 09 09 6f |.{...top|5++;...o|
|00000310| 66 66 73 65 74 28 6d 79 | 56 43 52 2e 64 61 79 2c |ffset(my|VCR.day,|
|00000320| 20 6d 79 56 43 52 2e 79 | 65 61 72 2c 20 74 6f 70 | myVCR.y|ear, top|
|00000330| 35 2c 20 28 26 6f 66 6f | 75 74 29 2c 20 28 26 6a |5, (&ofo|ut), (&j|
|00000340| 29 29 20 3b 0d 09 09 69 | 66 28 6a 20 3d 3d 20 73 |)) ;...i|f(j == s|
|00000350| 34 5f 6f 75 74 29 20 64 | 6f 6e 65 66 6c 61 67 20 |4_out) d|oneflag |
|00000360| 3d 20 31 3b 0d 09 7d 0d | 0d 09 2f 2a 20 68 61 76 |= 1;..}.|../* hav|
|00000370| 65 20 74 77 6f 20 6f 66 | 20 74 68 65 20 74 68 72 |e two of| the thr|
|00000380| 65 65 20 69 6e 70 75 74 | 73 20 74 6f 20 73 74 65 |ee input|s to ste|
|00000390| 70 20 35 3b 20 64 65 74 | 65 72 6d 69 6e 65 20 74 |p 5; det|ermine t|
|000003a0| 68 65 20 72 65 6d 20 2a | 2f 0d 09 66 6f 72 28 72 |he rem *|/..for(r|
|000003b0| 65 6d 3d 30 3b 20 72 65 | 6d 3c 33 32 3b 20 72 65 |em=0; re|m<32; re|
|000003c0| 6d 2b 2b 29 0d 09 7b 0d | 09 09 6a 20 3d 20 28 72 |m++)..{.|..j = (r|
|000003d0| 65 6d 20 2b 20 28 6d 79 | 56 43 52 2e 64 61 79 2a |em + (my|VCR.day*|
|000003e0| 28 6d 79 56 43 52 2e 6d | 6f 6e 74 68 2b 31 29 29 |(myVCR.m|onth+1))|
|000003f0| 20 2b 20 6f 66 6f 75 74 | 29 20 25 20 33 32 20 3b | + ofout|) % 32 ;|
|00000400| 0d 09 09 69 66 28 6a 20 | 3d 3d 20 73 35 5f 6f 75 |...if(j |== s5_ou|
|00000410| 74 29 20 62 72 65 61 6b | 20 3b 0d 09 7d 0d 09 71 |t) break| ;..}..q|
|00000420| 75 6f 20 3d 20 28 6d 79 | 56 43 52 2e 64 61 79 20 |uo = (my|VCR.day |
|00000430| 2d 20 31 29 3b 0d 0d 0d | 09 2f 2a 20 61 73 73 65 |- 1);...|./* asse|
|00000440| 6d 62 6c 65 20 74 68 65 | 20 6f 75 74 70 75 74 20 |mble the| output |
|00000450| 6f 66 20 73 74 65 70 20 | 31 20 2a 2f 0d 09 62 6f |of step |1 */..bo|
|00000460| 74 33 20 3d 20 31 20 2b | 20 72 65 6d 20 2b 20 28 |t3 = 1 +| rem + (|
|00000470| 33 32 20 2a 20 71 75 6f | 29 20 3b 0d 09 73 31 5f |32 * quo|) ;..s1_|
|00000480| 6f 75 74 20 3d 20 62 6f | 74 33 20 2b 20 28 31 30 |out = bo|t3 + (10|
|00000490| 30 30 20 2a 20 74 6f 70 | 35 29 20 3b 0d 0d 09 2f |00 * top|5) ;.../|
|000004a0| 2a 20 69 6e 76 65 72 74 | 20 74 68 65 20 6d 69 78 |* invert| the mix|
|000004b0| 69 6e 67 20 2a 2f 0d 09 | 6d 79 56 43 52 2e 63 6f |ing */..|myVCR.co|
|000004c0| 64 65 20 3d 20 66 31 28 | 73 31 5f 6f 75 74 29 3b |de = f1(|s1_out);|
|000004d0| 0d 09 4e 75 6d 54 6f 53 | 74 72 69 6e 67 28 6d 79 |..NumToS|tring(my|
|000004e0| 56 43 52 2e 63 6f 64 65 | 2c 20 63 6f 64 65 54 65 |VCR.code|, codeTe|
|000004f0| 78 74 29 3b 0d 09 0d 09 | 53 65 74 44 54 65 78 74 |xt);....|SetDText|
|00000500| 28 64 6c 67 50 4c 55 53 | 43 4f 44 45 2c 20 63 6f |(dlgPLUS|CODE, co|
|00000510| 64 65 54 65 78 74 29 3b | 0d 0d 09 72 65 74 75 72 |deText);|...retur|
|00000520| 6e 3b 0d 7d 0d 0d 00 00 | 00 00 00 00 00 00 00 00 |n;.}....|........|
|00000530| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000540| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000550| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000560| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000570| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000580| 00 00 01 00 00 00 02 68 | 00 00 01 68 00 00 00 5a |.......h|...h...Z|
|00000590| 73 2e 68 22 0d 0d 65 78 | 74 65 72 6e 09 76 63 72 |s.h"..ex|tern.vcr|
|000005a0| 49 6e 66 6f 09 6d 79 56 | 43 52 3b 0d 0d 76 6f 69 |Info.myV|CR;..voi|
|000005b0| 09 65 6e 63 6f 64 65 72 | 2e 63 02 00 00 00 50 61 |.encoder|.c....Pa|
|000005c0| 72 74 53 49 54 78 00 00 | 00 00 00 00 00 00 00 01 |rtSITx..|........|
|000005d0| 00 00 50 61 72 74 53 49 | 54 78 00 00 00 00 00 00 |..PartSI|Tx......|
|000005e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005f0| 00 00 a9 7e a4 23 00 00 | 00 00 00 00 02 c2 74 6f |...~.#..|......to|
|00000600| 70 35 2c 20 71 75 6f 2c | 20 72 65 6d 2c 20 6e 65 |p5, quo,| rem, ne|
|00000610| 77 73 70 61 70 65 72 20 | 3b 0d 09 6c 6f 6e 67 20 |wspaper |;..long |
|00000620| 09 73 34 5f 6f 75 74 2c | 20 73 35 5f 6f 75 74 2c |.s4_out,| s5_out,|
|00000630| 20 6f 66 6f 75 74 2c 20 | 63 76 61 6c 20 3b 0d 0d | ofout, |cval ;..|
|00000640| 0d 09 2f 2a 20 67 65 74 | 20 74 68 65 20 20 74 20 |../* get| the t |
|00000650| 20 62 69 74 73 20 61 6e | 64 20 74 68 65 20 20 63 | bits an|d the c|
|00000660| 20 20 62 69 74 73 20 2a | 2f 0d 09 63 76 61 6c 20 | bits *|/..cval |
|00000670| 3d 20 6d 79 56 43 52 2e | 63 68 61 6e 6e 65 6c 20 |= myVCR.|channel |
|00000680| 00 00 00 04 00 06 00 04 | 00 00 00 0a 00 09 06 47 |........|.......G|
|00000690| 65 6e 65 76 61 00 00 00 | 01 4e 00 0e 00 16 00 00 |eneva...|.N......|
|000006a0| 00 e0 00 0d 00 de 8b 80 | 00 00 07 73 31 5f 6f 75 |........|...s1_ou|
|000006b0| 74 20 00 14 00 00 00 e0 | 00 0d 00 de 8b 70 00 00 |t ......|.....p..|
|000006c0| 05 62 6f 74 33 20 00 40 | 00 00 00 e0 00 0d 00 de |.bot3 .@|........|
|000006d0| 8b 48 80 00 00 2e 02 6e | 00 e2 03 10 47 1c 00 00 |.H.....n|....G...|
|000006e0| 00 00 00 07 00 00 00 01 | 00 01 00 01 00 02 00 01 |........|........|
|000006f0| 00 03 00 01 00 04 00 01 | 00 05 00 01 00 06 00 01 |........|........|
|00000700| 05 6d 79 56 43 52 00 14 | 00 00 00 e0 00 0d 00 de |.myVCR..|........|
|00000710| 8a e8 00 00 05 74 6f 70 | 35 20 00 12 00 00 00 e0 |.....top|5 ......|
|00000720| 00 0d 00 de 8a d8 00 00 | 03 71 75 6f 00 12 00 00 |........|.quo....|
|00000730| 00 e0 00 0d 00 de 8a c8 | 00 00 03 72 65 6d 00 16 |........|...rem..|
|00000740| 00 00 00 e0 00 0d 00 de | 8a b8 00 00 07 73 34 5f |........|.....s4_|
|00000750| 6f 75 74 20 00 16 00 00 | 00 e0 00 0d 00 de 8a a8 |out ....|........|
|00000760| 00 00 07 73 35 5f 6f 75 | 74 20 00 14 00 00 00 e0 |...s5_ou|t ......|
|00000770| 00 0d 00 de 8a 98 00 00 | 05 6f 66 6f 75 74 00 14 |........|.ofout..|
|00000780| 00 00 00 e0 00 0d 00 00 | 00 00 00 00 05 63 76 61 |........|.....cva|
|00000790| 6c 20 00 10 00 00 00 e0 | 00 0d 00 de 8a 7c 00 00 |l ......|.....|..|
|000007a0| 01 6a 00 18 00 00 00 e0 | 00 0d 00 de 8a 6c 00 00 |.j......|.....l..|
|000007b0| 09 64 6f 6e 65 66 6c 61 | 67 20 00 18 00 00 00 e0 |.donefla|g ......|
|000007c0| 00 0d 00 00 00 00 00 00 | 09 74 72 61 69 6c 65 72 |........|.trailer|
|000007d0| 73 20 00 16 00 00 00 e0 | 00 0d 00 de 8a 50 00 00 |s ......|.....P..|
|000007e0| 07 74 62 6c 69 64 78 20 | 00 00 01 00 00 00 02 68 |.tblidx |.......h|
|000007f0| 00 00 01 68 00 00 00 5a | 01 17 16 bc 09 8e 00 00 |...h...Z|........|
|00000800| 00 1c 00 5a 00 02 45 54 | 41 42 00 00 00 1a 45 46 |...Z..ET|AB....EF|
|00000810| 4e 54 00 00 00 26 44 54 | 56 55 00 00 00 32 03 ec |NT...&DT|VU...2..|
|00000820| ff ff 00 00 00 00 00 00 | 00 00 03 eb ff ff 00 00 |........|........|
|00000830| 00 08 00 00 00 00 3f 7c | ff ff 00 00 00 16 00 00 |......?||........|
|00000840| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000850| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000860| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000870| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+